package com.flexpasta.italianstore.remote.request
{
	import com.flexpasta.italianstore.remote.fault.DefaultFaultHandler;
	import com.flexpasta.italianstore.remote.result.PastaRemoteRs;
	import com.flexpasta.italianstore.vo.PastaType;
	import com.flexpasta.penneframework.remote.PenneRemoteObject;
	import com.flexpasta.penneframework.remote.ServiceLocator;
	import com.flexpasta.penneframework.remote.request.IPenneRequest;

	/** 
	 * @See interface documentation
	 * @author Brian Telintelo 
	 */
	public class PastaRemoteRq implements IPenneRequest, IPastaRemoteRq
	{
		private var service : PenneRemoteObject;
		private var result : PastaRemoteRs = PastaRemoteRs.getInstance();
		private var dfault : DefaultFaultHandler = new DefaultFaultHandler();
		
		private static const REMOTE_SERVICE_NAME:String = "pastaRemoteService";

		public function getPastaTypes():void
		{			
			service = ServiceLocator.getInstance().getRemoteObject( REMOTE_SERVICE_NAME, this, result.getPastaTypes, dfault.handleDefault);
			service.getPastaTypes();
		}
		
		public function updatePastaType(pastaType:PastaType):void
		{
			service = ServiceLocator.getInstance().getRemoteObject( REMOTE_SERVICE_NAME, this, result.updatePastaType, dfault.handleDefault);
			service.getPastaTypes();
		}
		
	}
}